import java.util.Scanner;

public class Text2 {
    public static void main(String[] args) {
        Scanner sca = new Scanner(System.in);
        int num = sca.nextInt();
        while(num != 0){
            int n = num%10;
            System.out.println(n);
            num = num/10;
        }
    }
}
